﻿using JetBrains.Annotations;
using Missbot.Core.Base;
using Missbot.Model.MsgInfos;
using Newtonsoft.Json;

namespace Missbot.Core.Channels
{
    /// <summary>
    /// 通知通道
    /// </summary>
    [UsedImplicitly]
    public class NotificationChannel : IMsgChannel
    {
        public override string Name => "notice";
        public override ChannelType BindingType => ChannelType.Notification;
        public override string ChannelFlag => "notification";

        protected override void Send(OutboxDTO dto)
        {
        }

        protected override InboxSession ParseDataImpl(string msg)
        {
            var noticeInfo = JsonConvert.DeserializeObject<NotificationInfo>(msg);
            if (noticeInfo?.Body == null)
            {
                return null;
            }

            // todo
            return null;
        }
    }
}